
$(function () {
    $(".year").html($("#year").val());
    $(".lastyear").html(Number($("#year").val()) - 1);
    $(".fifthyear").html(Number($("#year").val()) + 5);
    $.ajax({
        type: "post",
        data: {"reportId": $("#reportId").val()},
        url: "/write/getWrites",
        dataType: "json",
        success: function (data) {
            var columNum = $("#body tr:first td").length - 2;
            var row = data.length / columNum;
            initTable(row);
            //页面数据重显
            var industryName = $("#industryName").val();
            $(".industryLabel").each(function () {
                $(this).text(industryName);
            })

            for (var i = 0; i < data.length; i++) {
                $("#" + data[i].inputName).val(data[i].s1);
                if (data[i].writeId != null) {
                    document.getElementById(data[i].inputName).setAttribute("writeId", data[i].writeId);
                }
            }
        },
        error: function () {
            layer.alert("操作请求错误，请您稍后再试", function () {
                layer.closeAll();
            });
        }
    });
    $("input").attr("readonly","readonly");
    $("textarea").attr("readonly","readonly");
})